<?php

$username = 'mcn02001';
$password = 'sylvan17';

$curl = curl_init("https://secure.uconn.edu/transportation/login/success.html");
//  " .$username . ":" . $password . "@
curl_setopt($curl,CURLOPT_USERPWD,$username . ":" . $password);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_FOLLOWLOCATION,true);

$curl_result = curl_exec($curl);

$output .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>';

if($curl_result === false) {
	$output .= "<h1>An error occurred.</h1>\n";
	$output .= "<h2>Error " . curl_errno($curl) . ": " . curl_error($curl) . "</h2>\n";
} else {
	$output .= "<h1>Login was successful.</h1>\n";
} 
$output .= "<pre>\n";
$output .= print_r(curl_getinfo($curl),true);
$output .= "</pre>\n";
$output .= $curl_result;
print "--- NO OUTPUT ---";
print $output;
?>